/*
 * UMediaFilter.h
 *
 *  Created on: 2020年4月29日
 *      Author: chuanjiang.zh
 */

#ifndef UMEDIAFILTER_H_
#define UMEDIAFILTER_H_

#include "UMediaSource.h"
#include "UMediaSinkArray.h"
#include "UString.h"


class DLLEXPORT UMediaFilter : public UMediaSource, public UMediaSink
{
public:
	UMediaFilter();
	virtual ~UMediaFilter() {}


	virtual const char* getUrl();

	virtual bool getMediaFormat(UMediaFormat& fmt);

	virtual int startStream();

	virtual int pauseStream();

	virtual void stopStream();

	virtual int getState();

	virtual bool addSink(UMediaSink* pSink);

	virtual void removeSink(UMediaSink* pSink);

	virtual void removeSinks();

	virtual size_t getSinkCount();

	virtual int forceKeyFrame();

	virtual int getDuration();

	virtual bool setScale(float scale);

    virtual float getScale();

	virtual bool isSeekable();

	virtual bool seek(int64_t pos);

	virtual int64_t getTime();

protected:
	void setState(UMediaState state);

protected:
	UMediaSinkArray	m_sinks;
	UString	m_url;
	UMediaFormat	m_format;

	UMediaState		m_state;

};

#endif /* UMEDIAFILTER_H_ */
